<?php get_header(); ?>
<div id="content">
<?php if (have_posts()) : ?>

	<?php $post = $posts[0]; ?>
	<?php if (is_category()) { ?>				
		<h2 id="pagetitle">分类  &raquo; <?php echo single_cat_title(); ?> </h2>

	  <?php } elseif(is_tag()) { ?>
		<h2 id="pagetitle">标签  &raquo; <?php single_tag_title(); ?></h2>
		
 	  <?php } elseif (is_day()) { ?>
		<h2 id="pagetitle">分类  &raquo; <?php the_date(); ?></h2>
		
	 <?php } elseif (is_month()) { ?>
		<h2 id="pagetitle">分类 &raquo; <?php the_time('Y年m月'); ?></h2>

		<?php } elseif (is_year()) { ?>
		<h2 id="pagetitle">分类  &raquo; <?php the_time('Y年'); ?></h2>
		

	<?php } elseif (is_author()) { ?>
		<?php 
			if(isset($_GET['author_name'])) :
				$curauth = get_userdatabylogin($author_name); 
			else :
				$curauth = get_userdata(intval($author));
			endif; ?>
		<h2 id="pagetitle"><?php echo $curauth->display_name; ?> 的所有文章</h2>

		<?php } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
		<h2 id="pagetitle">存档</h2>

		<?php } ?>


<?php while (have_posts()) : the_post(); ?>

	


<div class="post posthome" id="post-<?php the_ID(); ?>">

    <div class='postdate'>
                <strong><?php esc_attr( the_time('Y-m-d') ); ?></strong>
                <strong><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></strong>
                <strong>
                <?php if(comments_open() || pings_open()) : ?>
                <a href="<?php comments_link(); ?>" title="to Reply <?php the_title(); ?>">
                    <?php comments_number('0','1','%'); ?></a>
                <?php else : ?>
                    评论已关闭
                <?php endif; ?>
                </strong>
			</div>

    <?php if ($wp_query->current_post<-1) { ?>
	<div class="postcontent">
		<?php the_excerpt() ?>
	</div>
	<?php } ?>
    
</div>

<?php endwhile; else :

	echo walleve_404_message(); 

endif; ?>


	<?php if(!(is_page() || is_single()) ){ ?>
		<div id="pagenav">
			<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
		</div>
	<?php } ?>
</div>
<?php walleve_sidebar() ?>
<?php get_footer(); ?>